﻿using System;
using System.Collections.Generic;
using Cos.Core.Model.Common;
using Cos.Module.Configuration.Data;

namespace Cos.Module.Configuration
{
    using Cos.Core.Attributes;

    public class CultureService : ICultureService
    {
        private readonly ICultureRepository cultureRepository;

        public CultureService(ICultureRepository cultureRepository)
        {
            this.cultureRepository = cultureRepository;
        }

        public Culture DefaultCulture
        {
            get { return this.cultureRepository.GetDefaultCulture(); }
        }

        public IEnumerable<Culture> GetCultures()
        {
            return this.cultureRepository.GetCultures();
        }
        
        public Culture GetCulture(string cultureCode)
        {
            return this.cultureRepository.GetCulture(cultureCode);
        }

        public Culture SaveCulture(Culture culture)
        {
            return this.cultureRepository.SaveCulture(culture);
        }
    }
}